package com.example.springdata.multithread;

public class TestThreadHero {
    public static void main(String[] args) {
        Hero gareen=new Hero("A",200,50);
        Hero teemo=new Hero("B",300,30);
        Hero bh=new Hero("C",500,65);
        Hero lessin=new Hero("D",400,80);
//        while(!teemo.isDead()){
//            gareen.attachHero(teemo);
//        }
//        while(!lessin.isDead()){
//            bh.attachHero(lessin);
//        }
        Thread t1=new KillHero(gareen,teemo);
        Thread t2=new KillHero(bh,lessin);
        t1.start();
        try {
            t1.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        t2.start();
    }
}
